package edu.uniquindio.prmaven.proyectofinal;

import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.testng.Assert;
import org.testng.annotations.Test;

import edu.uniquindio.prmaven.general.TestCore;

public class CheckBox_2 extends TestCore {
	
	@Test()
	/**
	dataProviderClass = edu.uniquindio.prmaven.dataprovider.DataProviderFactory.class, 
	dataProvider = ConfigurationConstants.DP_FACTORY
	@DataProviderArguments(ConfigurationConstants.ESCENARIO
			+ ConfigurationConstants.EQUALS + DataProvidersConstants.HOJA_1)
			**/
	
	public void testCheckBox_2() throws Exception {
		
		try {
			
		selenium.open("/showcase/");
		
		//selenium.click("id=SubMenu-Input"); Seleccionar menu Input
		WebElement menuInput=driver.findElement(By.id("SubMenu-Input"));
		menuInput.click();
		
		/*selenium.click("link=• ManyCheckbox"); xpath .//*[@id='MENUSIDEindent']/div[3]/a[14]
		Seleccion menu ManyCheckBox*/
		WebElement seleccionMenu=driver.findElement(By.xpath("//*[@id='MENUSIDEindent']/div[3]/a[14]"));
		seleccionMenu.click();
		
		selenium.waitForPageToLoad("30000");
		
		/* seleccion opcion Wii U 
		 * xpath..//*[@id='j_idt88:basic']/tbody/tr/td[5]/div/div[2]/span
		 */
		WebElement seleccion=driver.findElement(By.xpath
				("//*[@id='j_idt88:basic']/tbody/tr/td[5]/div/div[2]/span"));
		seleccion.click();
		
			
		//selenium.click("id=j_idt88:j_idt96"); .//*[@id='j_idt88:j_idt96'] boton submit
		WebElement botonSubmit=driver.findElement(By.xpath("//*[@id='j_idt88:j_idt96']"));
		botonSubmit.click();
		
		Assert.assertEquals(selenium.getText("css=div.ui-dialog-content.ui-widget-content"), 
				"Wii U \n\nNo records found.");
		
		//selenium.click("css=span.ui-icon.ui-icon-closethick"); cerrar mensaje
		WebElement cerrarM=driver.findElement(By.cssSelector("span.ui-icon.ui-icon-closethick"));
		cerrarM.click();

		
		
		selenium.waitForPageToLoad("5000");
		
	}catch(AssertionError e){
		System.out.println("no se encontro texto");
	}finally{
		
	}
}

}


